package com.baidu.speech.qr_code.ui;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;

import com.baidu.speech.qr_code.MainActivity;
import com.baidu.speech.qr_code.R;
import com.baidu.speech.qr_code.ui.Main.MainActivity_son;

import java.util.Timer;
import java.util.TimerTask;

public class MainActivity_image extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_image);
        // 加入定时切换界面功能
        Thread t = new Thread() {
            @Override
            public void run() {
                // 定时
                try {
                    Thread.sleep(2000);
                    // 切换下一个界面
                    Intent in = new Intent(MainActivity_image.this,
                            MainActivity_son.class);
                    startActivity(in);
                    // 当切换到下一个界面后,当前封面就关闭了
                    finish();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        };
        t.start();

    }
}